from SimpylScrape.Parsers import SiteParser, XpathParser

class NineThirtyClub(SiteParser):
    """
    http://www.930.com/concerts/
    """
    class concerts(XpathParser):
        """
        .//div[@class='concert_listing']
        """
        
        class details(XpathParser):
            """
            .//div[@class='primary']/div[@class='barholder']
            """
            price = "./div[@class='buy']/div[@class='price'][1]/text()"
            date = "./div[@class='info pointer']/div[@class='date'][1]/text()"
            startTime = "./div[@class='info pointer']/div[@class='doors'][1]/text()"            
        
        class main(XpathParser):
            """
            .//div[@class='primary']
            """
            name = ".//h2[@class='band pointer']/text()"
            image = ".//div[@class='lgImgHolder']/img/@src_lg"
            
            def bio(copy):
                """
                .//div[@class='name']/div[@class='copy']
                """
                return copy.text

            class links(XpathParser):
                """
                .//div[@class='copy']/div[@class="links"]/a
                """
                title = "./text()"
                link = "./@href"

        class supporting(XpathParser):
            """
            .//div[@class='secondary']
            """
            name = "./div[@class='name']/h2[@class='band']/text()"
            image = ".//div[@class='lgImgHolder']/@src_lg"
            
            def bio(copy):
                """
                ./div[@class='name']/div[@class='copy']
                """
                return copy.text

            class links(XpathParser):
                """
                ./div[@class='copy']/div[@class="links"]/a
                """
                title = "./text()"
                link = "./@href"

